#include "widget.h"
#include "ui_widget.h"
#include <QDebug>

Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);

    //点击设置按钮，将小控件设置到一般位置
    connect(ui->btn_setTo50, &QPushButton::clicked, this, [=](){
        ui->widget->setValue(50);
    });

    //获取值
    connect(ui->btn_getValue, &QPushButton::clicked, this, [=](){
        int val = ui->widget->getValue();
        qDebug() << "当前值是:" << val;
    });
}

Widget::~Widget()
{
    delete ui;
}
